package com.neusoft.oa.controller.Notice;


import com.neusoft.oa.pojo.Draft;
import com.neusoft.oa.pojo.Email;
import com.neusoft.oa.pojo.Notice;
import com.neusoft.oa.service.INoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/notice")
@CrossOrigin
public class NoticeController {
    @Autowired
    INoticeService noticeService;

    @RequestMapping("noticelist")
    public List<Notice> list(Notice notice){
        return noticeService.noticeList(notice);
    }

    @RequestMapping("noticeinsert")
    public boolean insert(Notice noc){
        System.out.println(noc.getNocName()+","+noc.getNocType()+","+noc.getNocContent());
        return noticeService.noticeInsert(noc);
    }
    @RequestMapping("noticeupdate")
    public boolean noticeUpdate(Notice notice){
        return noticeService.noticeUpdate(notice);
    }

    @RequestMapping("noticedelete")
        public boolean delete(int nocId){

        return noticeService.noticeDelete(nocId);
    }

    @RequestMapping("noticedeletes")
    public boolean deletes(int []notices){
        return noticeService.noticesDelete(notices);

    }



}
